<template>
  <div>
    <h2>病 害 详 细 信 息</h2>
    <div class="info">
      <div class="left">
        <p>名称：{{ disease.diseaseName }}</p>
        <p>病原：{{ disease.diseaseSource }}</p>
        <p>发病症状：{{ disease.diseaseSymptoms }}</p>
        <p>发病规律：{{ disease.diseaseRegularity }}</p>
        <p>主要危害：{{ disease.diseaseMainHarm }}</p>
      </div>
      <div class="right">
        <span>图片</span>
        <img :src="/api/ + disease.diseasePic" alt="未找到" />
        <br /><br /><br />
        <p>防治措施：{{ disease.diseaseControl }}</p>
      </div>
    </div>
    <el-row>
      <el-button plain @click="back()">返回</el-button>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      diseaseId: "",
      disease: "",
    };
  },
  methods: {
    async getPestInfo(diseaseId) {
      let paramObj = { diseaseId: diseaseId };
      let info = await this.ajax.getSubmit("/api/disease/get", paramObj);
      console.log(info);
      this.disease = info;
    },
    back(){
      this.$router.push("/home/disease");
    }
  },
  created() {
    //console.log(this.$route.query.diseaseId);
    this.diseaseId = this.$route.query.diseaseId;
    this.getPestInfo(this.diseaseId);
  },
};
</script>

<style>
</style>